 {
        
        var o = require("../UIManager/UISoundManager.js");
        cc.Class({
            extends: cc.Component,
            properties: {
                spBubbleBg: {
                    default: null,
                    type: cc.Node
                },
                spBubbleTile: {
                    default: null,
                    type: cc.Label
                },
                btnTaskNode: {
                    default: null,
                    type: cc.Node
                },
                isCanGetAward: !1,
                isAlreadyGetAward: !1
            },
            start: function () {
                Global.msgHandler.requestTaskData();
            },
            onLoad: function () {
                Global.notificationCenter.on(Global.eventName.MSG_HAPPYBAG5, this.showTaskComplete.bind(this), this);
                var e = Global.configCdn.getActivityAndTaskConf() || Global.configCdn.getDefaultConfig("activityAndTask");
                e.mySteriousRedPacket && (this._mySteriousRedPacket = e.mySteriousRedPacket);
            },
            onDestroy: function () {
                Global.notificationCenter.offAll(this);
            },
            showTaskComplete: function (e) {
                cc.error("监听福袋任务相关，showTaskComplete");
                var t = this._mySteriousRedPacket, n = !1, o = null, i = null;
                if (e && "getreward" == e.action && "show_rewards" == e.todotasks.action && (this.isAlreadyGetAward = !0,
                    this.btnTaskNode.active = !1, cc.error("getreward++++++++++++++++++任务完成提醒")), e && t && t.length > 0 && "list" == e.action) {
                    for (var a = 0; a < t.length; a++) {
                        i = t[a];
                        for (var r = 0; r < e.tasks.length; r++) {
                            var s = e.tasks[r];
                            if (s && i.kindId == s[1] && 0 == s[3]) {
                                n = !0, o = s;
                                break;
                            }
                            s && i.kindId == s[1] && 1 == s[3] && (this.spBubbleBg.active = !0, this.spBubbleTile.string = "领取",
                                this.isCanGetAward = !0, this.btnTaskNode.active = !0, this.scheduleOnce(function () {
                                this.spBubbleBg.active = !1;
                            }.bind(this), 6)), s && i.kindId == s[1] && 2 == s[3] && (this.isAlreadyGetAward = !0,
                                this.btnTaskNode.active = !1);
                        }
                        if (n) break;
                    }
                    if (n && null != o) {
                        this.spBubbleBg.active = !0;
                        var l = this._mySteriousRedPacket[0].progressMax - o[2];
                        cc.error("leaveGame = ", l), 0 == l ? (this.spBubbleTile.string = "领取", this.isCanGetAward = !0) : this.spBubbleTile.string = "再赢" + l + "局可领",
                            this.scheduleOnce(function () {
                                this.spBubbleBg.active = !1;
                            }.bind(this), 4);
                    }
                } else this.spBubbleBg.active = !1;
                var c = Global.configCdn.getUISwitchConf(), d = !1;
                c && c.isMysteriousRedPacketTask && (d = c.isMysteriousRedPacketTask || !1), Global.roomInfoModel.getNotZiZunOrFuHao() ? this.btnTaskNode.active = !1 : this.isAlreadyGetAward ? this.btnTaskNode.active = !1 : this.btnTaskNode.active = d;
            },
            getRedPacketReward: function () {
                if (o.playEffect("select"), !this.isAlreadyGetAward) return 0 == this.isCanGetAward ? 1 == this.spBubbleBg.active ? void console.log("getRedPacketReward222222222 ") : 1 == this.spBubbleBg.active ? void console.log("getRedPacketReward3333333 ") : (this.spBubbleBg.active = !0,
                    console.log("getRedPacketReward222222222 "), void this.scheduleOnce(function () {
                    this.spBubbleBg.active = !1;
                }.bind(this), 4)) : void Global.UIPopupManager.addPopup("PopupPanel/Panel_LuckChoose", function (e) {
                });
                console.log("getRedPacketReward1111111 ");
            }
        })
    }